<%@page import="doantotnghiep.modelDTO.WorkPlaymentDTO"%>
<%@page import="doantotnghiep.model.WorkPlayment"%>
<%@page import="doantotnghiep.modelDTO.DivisionRoomDTO"%>
<%@page import="java.util.HashMap"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="doantotnghiep.model.Customer"%>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@page import="java.util.ArrayList"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Thêm nhân viên</title>
<script type="text/javascript">
	$(function() {
		$("#birthDay").datepicker();
		$("#birthDay").datepicker('setDate', new Date("1985"));
	});
</script>
</head>
<body>
	<%
		HashMap<String, Object> staffModel = (HashMap<String, Object>) request
				.getAttribute("staffModel");
	%>
	<br>
	<br>
	<div align="center" >
	<div id="addstaffsuccess" style="display: none; text-align:center; width: 300px; height: 50px; font-size: 20px;color: red;">
		<p>
			Thêm nhân viên thành công
		</p>
	
	</div>
		<center>
			<h1 style="color: blue;">THÊM NHÂN VIÊN</h1>
			<br> <br>
			<p style="color: green; font-size: 15px; font-weight: bold;"></p>
			<br>

			<div align="center">

				<form:form method="POST" commandName="StaffDTO">
					<table id="addstafftable" >

						<tr>
							<td><form:label  path="fullName">Họ tên nhân viên:</form:label></td>
							<td><form:input id= "staffname" path="fullName" value="${name}"></form:input>*</td>
							<td><span id="staffname-error" style="color:red"> </span></td>
						</tr>
						<tr>
							<td><form:label  path="birthDay">Ngày sinh:</form:label></td>
							<td><form:input id= "birthDay" path="birthDay" value="${name}"></form:input>*</td>
							<td><span id="staffbirthday-error" style="color:red"> </span></td>
						</tr>
						<tr>
							<td><form:label  path="identifyNumber">Số CMND:</form:label></td>
							<td><form:input id= "identifyNumber" path="identifyNumber" value="${name}"></form:input>*</td>
							<td><span id="staffidentifynumber-error" style="color:red"> </span></td>
						</tr>
						<tr>
							<td><form:label  path="address">Địa chỉ:</form:label></td>
							<td><form:input  id="staffaddress" path="address" value="${address}" />*</td>
							<td><span id="staffaddress-error" style="color:red"> </span></td>
						</tr>
						<tr>
							<td><form:label path="telNumber">Điện thoại:</form:label></td>
							<td><form:input  id="stafftelnumber" path="telNumber" value="${telNumber}" />*</td>
							<td><span id="stafftel-error" style="color:red"> </span></td>
						</tr>

						<tr>
							<td><form:label path="sex">Giới tính:</form:label></td>
							 <td><form:select path="sex" value="${sex}">
				             <option value="1">Nam</option>
				             <option value="0">Nữ</option>
						</form:select></td>
						</tr>
						<tr>
							<td><form:label  path="email">Email:</form:label></td>
							<td><form:input id ="staffemail" path="email" value="${email}" />*</td>
							<td><span id="staffemail-error" style="color:red"> </span></td>
						</tr>
						<tr>
							<td><form:label path="positionID">Chức vụ:</form:label>*</td>
							<td><form:select path="positionID" value="${positionID}">
									<%
										ArrayList<WorkPlaymentDTO> positionList = (ArrayList<WorkPlaymentDTO>) staffModel.get("positions");
												if (positionList != null) {
													for (int i = 0; i < positionList.size(); i++) {
									%>
									<option value="<%=positionList.get(i).getId()%>"><%=positionList.get(i).getPosition()%></option>
									<%
										}
												}
									%>

								</form:select>
						</tr>
						<tr>
							<td><form:label  path="income">Lương:</form:label></td>
							<td><form:input id= "staffincome" path="income" value="${name}"></form:input></td>
							<td><span id="staffincome-error" style="color:red; display: none;" > </span></td>
						</tr>
						<tr>
							<td><form:label path="room_ID">Phòng ban:</form:label></td>
							<td><form:select path="room_ID" value="${room_ID}">
									<%
										ArrayList<DivisionRoomDTO> roomList = (ArrayList<DivisionRoomDTO>) staffModel
														.get("listRoom");
												if (roomList != null) {
													for (int i = 0; i < roomList.size(); i++) {
									%>
									<option value="<%=roomList.get(i).getId()%>"><%=roomList.get(i).getRoomName()%></option>
									<%
										}
												}
									%>

								</form:select>
						</tr>

						<tr>
							<td ><input id="addstaffsubmit" type="button" value="Thêm" /></td>
							<td ><input id="addstaffcancel" type="button" value="Hủy" /></td></tr>
						
					</table>
				</form:form>


			</div>


		</center>
	</div>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
</body>
</html>
